package com.fesine.ch02.t8;

/**
 * @description: 类描述
 * @author: Fesine
 * @createTime:15:56
 *
 * @update:修改内容
 * @author: Fesine
 * @updateTime:15:56
 */
public class Task {
    synchronized public void otherMethod() {
        System.out.println("------------------run--otherMehod");

    }

    public void doLongTimeTask() {
        synchronized (this) {
            for (int i = 0; i < 10000; i++) {
                System.out.println("synchronized threadName="+Thread.currentThread().getName()
                +" i="+(i+1));
            }
        }
    }
}
